package com.esri.core.renderer;

import com.esri.core.internal.util.d;
import java.io.StringWriter;
import org.codehaus.jackson.JsonGenerator;

/* loaded from: classes.dex */
public class StretchRenderer implements RasterRenderer {
    private static final long a = 1;
    private static final String b = "stretch";
    private StretchParameters c;

    public void setStretchParameters(StretchParameters stretchParameters) {
        this.c = stretchParameters;
    }

    public StretchParameters getStretchParameters() {
        return this.c;
    }

    @Override // com.esri.core.renderer.RasterRenderer
    public String toJson() throws Exception {
        StringWriter stringWriter = new StringWriter();
        JsonGenerator a2 = d.a(stringWriter);
        a2.writeStartObject();
        toJson(a2);
        a2.writeEndObject();
        a2.close();
        return stringWriter.toString();
    }

    protected void toJson(JsonGenerator jsonGenerator) throws Exception {
        d.a(jsonGenerator, "type", b);
        StretchParameters stretchParameters = this.c;
        if (stretchParameters != null) {
            stretchParameters.a(jsonGenerator);
        }
    }
}
